package com.yqg.education.mapper;

import com.yqg.education.entity.Course;
import com.yqg.education.entity.ReceiveAnnounce;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 张芸博
 * @since 2025-04-10
 */
@Mapper
public interface ReceiveAnnounceMapper extends BaseMapper<ReceiveAnnounce> {
    List<ReceiveAnnounce> pageList(Integer pageNum, Integer pageSize, String title, Integer userId);

    Long findCount(String title, Integer userId);

    @MapKey("id")
    List<Map<String, Object>> stuFindReceiveAnnouncePage(@Param("pageStartNumber") Integer pageStartNumber,
                                                      @Param("pageSize") Integer pageSize,
                                                      @Param("name") String name,
                                                      @Param("userId") Integer userId);

    Long stuFindReceiveAnnouncePageCount(@Param("name") String name,
                                      @Param("userId") Integer userId);

    void stuUpdateStateBYAnnounceIdAndUserId(@Param("announceId") Integer announceId, @Param("userId") Integer userId);

    List<ReceiveAnnounce> getRecAnnouncePage(Integer pageNum, Integer pageSize, Long announceId);

    Long getRecAnnounceCount(Long announceId);
}
